/**
 * 路由跳转封装
 */

export default {
	// uni.navigateTo
	push(url, params = {}) {
		uni.$u.route({
			url,
			params,
			type: 'navigateTo'
		})
	},
	// uni.redirectTo
	replace(url, params = {}) {
		uni.$u.route({
			url,
			params,
			type: 'redirectTo'
		})
	},
	// uni.reLaunch
	replaceAll(url, params = {}) {
		uni.$u.route({
			url,
			params,
			type: 'reLaunch'
		})
	},
	// uni.switchTab
	pushTab(url, params = {}) {
		uni.$u.route({
			url,
			params,
			type: 'switchTab'
		})
	},
	// uni.navigateBack
	back(delta = 1) {
		uni.$u.route({
			delta,
			type: 'navigateBack'
		})
	}
}